import subprocess

p = subprocess.Popen("echo chinablue && uname && ls -al", shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
print(f"获取返回对象: {p}")
print(f"获取pid: {p.pid}")
print(f"获取返回数据: {p.stdout.read()}")
# p.wait()
# print(f"获取执行状态: {p.poll()}")
#
# p = subprocess.run("echo hello dj", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
# print(f'获取返回数据：{p.stdout}')
# print(f'获取返回数据：{p.returncode}')